package android.slc.app.startup;

import android.app.Application;
import android.slc.app.startup.TaskAppCreate;
import android.slc.app.startup.TaskConstant;

import com.blankj.utilcode.util.Utils;
import com.effective.android.anchors.task.project.Project;

public class TaskUtils {

    public static Project getAppTask(Application application) {
        return getAppTaskBuilder(application).build();
    }

    public static Project.Builder getAppTaskBuilder(Application application) {
        Project.Builder builder = new Project.Builder(TaskConstant.PROJECT_APP_PROJECT, new Project.TaskFactory(new TaskAppCreate(application)));
        builder.add(TaskConstant.TASK_FIRST);
        return builder;
    }

    public static Project getDelayTask() {
        return getDelayTaskBuilder().build();
    }

    public static Project.Builder getDelayTaskBuilder() {
        Project.Builder builder = new Project.Builder(TaskConstant.PROJECT_DELAY_PROJECT, new Project.TaskFactory(new TaskAppCreate(Utils.getApp())));
        builder.add(TaskConstant.TASK_THIRD_PART);
        builder.add(TaskConstant.TASK_SLC).dependOn(TaskConstant.TASK_THIRD_PART);
        return builder;
    }
}
